#!/usr/bin/env python
# coding=utf-8

from ctypes import *
import ctypes
import sys
import os

global dll

secretcode = bytes("47618246885295315015297022011108", "gbk")

plaincode = bytes("76322108521295315015228004071108", "gbk")

def loaddll():
    global dll
    dll = windll.LoadLibrary("TAEPS.dll")

def getmachinecode(strRequestcode):
    global dll
    requestcode = bytes(strRequestcode,"gbk")
    dll.GetMachineCode.restype = ctypes.c_char_p  # 修改lib.bar返回类型
    return dll.GetMachineCode(requestcode)

def getpollcode(strRequestcode):
    global dll
    requestcode = bytes(strRequestcode, "gbk")
    dll.GetPollCode.restype = ctypes.c_char_p  # 修改lib.bar返回类型
    return dll.GetPollCode(requestcode, 8, plaincode,secretcode)

